package cn.iocoder.yudao.module.crossborder.platform.dal.mysql.platformordermapping;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crossborder.platform.dal.dataobject.platformordermapping.PlatformOrderMappingDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformordermapping.vo.*;

/**
 * 跨境电商平台订单映射 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PlatformOrderMappingMapper extends BaseMapperX<PlatformOrderMappingDO> {

    default PageResult<PlatformOrderMappingDO> selectPage(PlatformOrderMappingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PlatformOrderMappingDO>()
                .eqIfPresent(PlatformOrderMappingDO::getPlatformId, reqVO.getPlatformId())
                .eqIfPresent(PlatformOrderMappingDO::getStoreId, reqVO.getStoreId())
                .eqIfPresent(PlatformOrderMappingDO::getLocalOrderId, reqVO.getLocalOrderId())
                .eqIfPresent(PlatformOrderMappingDO::getLocalOrderNo, reqVO.getLocalOrderNo())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformOrderId, reqVO.getPlatformOrderId())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformOrderNo, reqVO.getPlatformOrderNo())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformTransactionId, reqVO.getPlatformTransactionId())
                .eqIfPresent(PlatformOrderMappingDO::getMappingStatus, reqVO.getMappingStatus())
                .eqIfPresent(PlatformOrderMappingDO::getSyncStatus, reqVO.getSyncStatus())
                .betweenIfPresent(PlatformOrderMappingDO::getLastSyncTime, reqVO.getLastSyncTime())
                .eqIfPresent(PlatformOrderMappingDO::getSyncErrorMsg, reqVO.getSyncErrorMsg())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformStatus, reqVO.getPlatformStatus())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformPaymentStatus, reqVO.getPlatformPaymentStatus())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformFulfillmentStatus, reqVO.getPlatformFulfillmentStatus())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformTotalAmount, reqVO.getPlatformTotalAmount())
                .eqIfPresent(PlatformOrderMappingDO::getPlatformCurrency, reqVO.getPlatformCurrency())
                .betweenIfPresent(PlatformOrderMappingDO::getPlatformCreatedTime, reqVO.getPlatformCreatedTime())
                .betweenIfPresent(PlatformOrderMappingDO::getPlatformUpdatedTime, reqVO.getPlatformUpdatedTime())
                .eqIfPresent(PlatformOrderMappingDO::getAutoSync, reqVO.getAutoSync())
                .betweenIfPresent(PlatformOrderMappingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PlatformOrderMappingDO::getId));
    }

}